<!doctype html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Export to PDF/PNG</title>
</head>
	<script src="../../codebase/dhtmlxscheduler.js?v=5.3.10" type="text/javascript" charset="utf-8"></script>

	<script src="../../codebase/ext/dhtmlxscheduler_year_view.js?v=5.3.10" type="text/javascript" charset="utf-8"></script>
	<script src="../../codebase/ext/dhtmlxscheduler_agenda_view.js?v=5.3.10" type="text/javascript" charset="utf-8"></script>
	<script src="//export.dhtmlx.com/scheduler/api.js?v=5.3.10" type="text/javascript" charset="utf-8"></script>

	<link rel="stylesheet" href="../../codebase/dhtmlxscheduler_material.css?v=5.3.10" type="text/css" charset="utf-8">
	<link rel="stylesheet" href="../common/controls_styles.css?v=5.3.10">
	
<style type="text/css" >
	html, body{
		margin:0px;
		padding:0px;
		height:100%;
	}
	.controls{
		height: 150px;
	}
	.controls>div:nth-child(1){
		width: 500px;
		padding-bottom: 14px;
		float: left;
	}
	.controls>div:nth-child(2){
		padding-top: 8px;
		text-align: left;
	}
	.controls input, .controls select{
		padding:5px 20px;
		margin: 7px 15px 0 0;
		width:180px;
	}
	.controls label{
		float:left;
		width:184px;
		text-align: right;
		padding: 4px 20px 0 0;
		line-height: 32px;
		display: block;
	}
</style>

<script type="text/javascript" charset="utf-8">
	function init() {
		scheduler.init('scheduler_here',new Date(2017,5,30),"month");
		scheduler.load("../common/events.json")
	}
	function exportScheduler(type){
		var format = document.getElementById("format").value;
		var orient = document.getElementById("orient").value;
		var zoom = document.getElementById("zoom").value;
		if (type == "pdf")
			scheduler.exportToPDF({
				format:format,
				orientation:orient,
				zoom:zoom
			});
		else
			scheduler.exportToPNG({
				format:format,
				orientation:orient,
				zoom:zoom
			});
	}
</script>

<body onload="init();">
	<div class='sch_control controls'>
		<div>
			<div>
				<label>Format</label>
				<select id="format">
					<option>A5</option>
					<option selected="true">A4</option>
					<option>A3</option>
					<option>A2</option>
					<option>A1</option>
					<option>A0</option>
				</select>
			</div>
			<div>
				<label>Orientation</label>
				<select id="orient">
					<option>portrait</option>
					<option>landscape</option>
				</select>
			</div>
			<div>
				<label>Zoom</label>
				<select id="zoom">
					<option>0.5</option>
					<option>0.75</option>
					<option selected="true">1</option>
					<option>1.5</option>
					<option>2</option>
				</select>
			</div>
		</div>
		<div>
			<input type="button" value="Export to PDF" onclick='exportScheduler("pdf")'>
			<input type="button" value="Export to PNG" onclick='exportScheduler("png")'>
		</div>
	</div>

	<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
		<div class="dhx_cal_navline">
			<div class="dhx_cal_prev_button">&nbsp;</div>
			<div class="dhx_cal_next_button">&nbsp;</div>
			<div class="dhx_cal_today_button"></div>
			<div class="dhx_cal_date"></div>

			<div class="dhx_cal_tab" name="year_tab" style="right:330px;"></div>
			<div class="dhx_cal_tab" name="agenda_tab" style="right:265px;"></div>
			<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
			<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
			<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
		</div>
		<div class="dhx_cal_header">
		</div>
		<div class="dhx_cal_data">
		</div>		
	</div>
</body>
